/**
 * Copyright (C), 2020-2021 by colley.ma
 * File Name: ConfigClientAdapter.java
 * Encoding: UTF-8
 * Date: 2021年7月29日 下午5:45:22
 * History:
 */
package com.swak.frame.config;

import java.util.Date;
import java.util.Map;
import java.util.Set;

import com.swak.frame.util.MapBean;

/**
 * 配置中心适配
 * 
 * @author mayuanchao
 *
 */
public interface ConfigCenterAdapter {

    public String getString(String key, String defaultVal);

    public String getString(String key);

    /**
     * get conf (boolean)
     *
     * @param key
     * @return
     */
    public boolean getBoolean(String key, boolean defaultVal);

    public boolean getBoolean(String key);

    /**
     * get conf (int)
     *
     * @param key
     * @return
     */
    public Integer getInt(String key, Integer defaultVal);

    public Integer getInt(String key);

    /**
     * get conf (long)
     *
     * @param key
     * @return
     */
    public Long getLong(String key, Long defaultVal);

    public Long getLong(String key);

    public Double getDouble(String key, Double defaultVal);

    public Double getDouble(String key);

    public Set<String> getSets(String key);

    /**
     * 时间转换
     * 
     * @param key
     * @param pattern
     * @return
     */
    public Date getDate(String key, String pattern);

    public <T> T getObject(String key, Class<T> clazz);

    public String hget(String key, String filed);

    public Map<String, String> getMap(String key);

    public MapBean getMapBean(String key);
}
